package com.ayf.payment.game.api.mapper;

import com.ayf.payment.game.api.dto.PartitionChangeDTO;
import com.ayf.payment.game.api.dto.PartitionDTO;
import com.ayf.payment.game.api.dto.criteria.PartitionCriteria;
import com.ayf.payment.game.api.dto.criteria.PartitionPageCriteria;
import com.ayf.payment.game.api.dto.criteria.PartitionSelectCriteria;
import com.ayf.payment.game.api.entity.Partition;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;
import java.util.Map;

public interface PartitionMapper extends Mapper<Partition> {

    List<PartitionDTO> selectByDTO(PartitionSelectCriteria selectCriteria);

    List<PartitionDTO> selectByPageDTO(PartitionPageCriteria selectCriteria);

    PartitionCriteria selectPartitionCriteria(Map map);

    PartitionChangeDTO selectPartitionChangeDTO(Map map);

    List<Partition>  selectByOpeningTime(PartitionSelectCriteria selectCriteria);

    String save(Partition entity);

    void updatePartition(Partition entity);

    /**
     * 更改分区名称
     *
     * @param partition
     * @return
     */
    int updatePartitionName(@Param("partition") Partition partition);

    /**
     * 查询出分区信息
     *
     * @param groupId
     * @return
     */
    List<PartitionDTO> selectPartitionByGroupId(@Param("groupId") String groupId,@Param("curDate") String curDate);

    /**
     * 查询商户的分区数量
     *
     * @param merchantId
     * @return
     */
    int selectPartSum(@Param("merchantId") Integer merchantId);

    List<Partition> selectEnablePartitionList(@Param("merchantId") Integer merchantId,@Param("curDate") String curDate);

    List<PartitionDTO> selectByGameId(@Param("cri") PartitionSelectCriteria selectCriteria);

    List<String> selectGameCurrencyName(@Param("merchantId") Integer merchantId);


    List<PartitionDTO> getPartitionList(PartitionSelectCriteria selectCriteria);

    List<Partition> selectByChangeNameTime(PartitionSelectCriteria selectCriteria);

}